class Musician < ActiveRecord::Base
  has_one :live
  attr_human_name :name => 'ミュージシャン名', :ruby => 'ふりがな', :text => '説明', :movie => '動画', :image => '画像'
  #file_column :image, :magick => {:size => "75x100!"}
  file_column :image,
    :magick => {:versions => {
      :small  => {:size => "75x100"},
      :large  => {:size => "320x240"}
    }
  }
  file_column :movie
  validates_presence_of :name, :ruby, :text
  validates_uniqueness_of :name, :ruby
  validates_file_format_of(:image, :in => ["gif", "png", "jpg"], :message => "はGIF,JPG,PNG画像でなければなりません")
  validates_file_format_of(:movie, :in => ["mov", "wmv", "avi", "mp4", "flv"], :message => "はmov,wmv,avi,mp4,flv動画でなければなりません")
  validates_format_of(:ruby, :with => %r{[ぁ-ん]}i, :message => "はひらがなでなければなりません。")
end
